Minghan/filter sentry wharton403#406
Conversation
There was a problem hiding this comment.
Pull request overview
Updates production Sentry configuration to drop a noisy, known error and extends the laundry API wrapper response with additional timing/status details for clients.
Changes:
- Add a
before_sendhook in production settings to filter out a specific Wharton 403 Sentry event. - Extend laundry machine aggregation to track remaining time in seconds.
- Add richer per-machine detail fields (
time_remaining_seconds,finishes_at, cycle/modifier info, and display status).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| backend/pennmobile/settings/production.py | Adds a Sentry before_send filter to suppress a specific recurring error event. |
| backend/laundry/api_wrapper.py | Adds seconds-level remaining time tracking and new per-machine detail fields in the laundry response. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -21,7 +22,23 @@ | |||
|
|
|||
| # Sentry settings | |||
| SENTRY_URL = os.environ.get("SENTRY_URL", "") | |||
| sentry_sdk.init(dsn=SENTRY_URL, integrations=[CeleryIntegration(), DjangoIntegration()]) | |||
|
|
|||
|
|
|||
| def before_send(event: Event, hint: Hint) -> Event | None: | |||
| if ( | |||
25cdfaa to
b0aa7ae
Compare
b0aa7ae to
eb58f24
Compare
There was a problem hiding this comment.
Pull request overview
Adds a Sentry before_send hook in the production Django settings to drop a known-noisy Wharton 403 error event before it’s reported.
Changes:
- Import Sentry SDK type hints (
Event,Hint) for the hook signature. - Add
before_sendfilter to discard events whose log message containsWharton: Error 403 when reserving data. - Wire
before_sendintosentry_sdk.init(...)in production.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the backend’s production Sentry configuration to drop a specific noisy error (“Wharton: Error 403 when reserving data”) before it is sent to Sentry, reducing alerting/log noise in production.
Changes:
- Adds a
before_sendcallback inproduction.pyto filter out events containing the target Wharton 403 message. - Updates
sentry_sdk.init(...)to register thebefore_sendhook. - Introduces type annotations for the callback using
sentry_sdk.types.EventandHint.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
No description provided.